From 30b12ff89081882aa15b70a40d7764c58fbba37f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 29 Apr 2023 13:46:47 -0400 Subject: [PATCH] docs: Mention baselines Add a paragraph about baselines to the coordinates overview. --- docs/reference/gtk/coordinates.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/reference/gtk/coordinates.md b/docs/reference/gtk/coordinates.md index 6c9890cec4..afb77e2bda 100644 --- a/docs/reference/gtk/coordinates.md +++ b/docs/reference/gtk/coordinates.md @@ -44,6 +44,10 @@ widgets (although most of the time, the transformation will be a simple 2D trans The transform to go from one widgets coordinate system to another one can be obtained with [method@Gtk.Widget.compute_transform]. +In addition to a size, widgets can optionally have a **_baseline_** to position text on. +Containers such as [class@Gtk.Box] may position their children to match up their baselines. +[method@Gtk.Widget.get_baseline] returns the y position of the baseline in widget coordinates. + When widget APIs expect positions or areas, they need to be expressed in this coordinate system, typically called **_widget coordinates_**. GTK provides a number of APIs to translate between different widgets' coordinate systems, such as [method@Gtk.Widget.compute_point] -- 2.30.2